<nz-card>
    <button nz-button (click)="add(modalContent)" [nzType]="'primary'">
        <i class="anticon anticon-plus"></i>
        <span>新建</span>
    </button>

    <button nz-button (click)="export(modalContent2)" [nzType]="'primary'">
        <i class="anticon anticon-plus"></i>
        <span>导入</span>
    </button>

    <ng-container *ngIf="selectedRows.length > 0">
        <button nz-button class="ml-sm">批量操作</button>
        <nz-dropdown [nzPlacement]="'bottomLeft'">
            <button nz-button nz-dropdown class="ml-sm">
                更多操作
                <i class="anticon anticon-down"></i>
            </button>
            <ul nz-menu>
                <li nz-menu-item (click)="remove()">删除</li>
                <!-- <li nz-menu-item (click)="approval()">批量审批</li> -->
            </ul>
        </nz-dropdown>
    </ng-container>
    <div class="my-md">
        <nz-alert [nzType]="'info'" [nzShowIcon]="true" [nzMessage]="message">
            <ng-template #message>
                已选择
                <strong class="text-primary">{{selectedRows.length}}</strong> 项&nbsp;&nbsp;
                <a *ngIf="totalCallNo > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
            </ng-template>
        </nz-alert>
    </div>
    <simple-table #st [columns]="columns" [data]="data" [loading]="loading" (checkboxChange)="checkboxChange($event)" (filterChange)="getData()">
        <ng-template st-row="status" let-i>
            <nz-badge [nzStatus]="i.statusType" [nzText]="i.statusText"></nz-badge>
        </ng-template>
    </simple-table>
</nz-card>

<ng-template #modalContent>
    <form nz-form [formGroup]="form">
        <nz-form-item>
            <nz-form-label nzXs="5" nzRequired nzFor="name">名称</nz-form-label>
            <nz-form-control nzXs="18">
                <input nz-input formControlName="name" id="name" placeholder="">
                <nz-form-explain *ngIf="form.get('name').dirty && form.get('name').errors">不能为空</nz-form-explain>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label nzXs="5" nzRequired nzFor="resourceUrl">资源地址</nz-form-label>
            <nz-form-control nzXs="18">
                <input nz-input formControlName="resourceUrl" id="resourceUrl" placeholder="">
                <nz-form-explain *ngIf="form.get('resourceUrl').dirty && form.get('resourceUrl').errors">不能为空</nz-form-explain>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label nzXs="5" nzRequired nzFor="detail">详情html</nz-form-label>
            <nz-form-control nzXs="18">
                <textarea nz-input formControlName="detail" id="detail" [nzAutosize]="{minRows: 4}" placeholder=""></textarea>
                <nz-form-explain *ngIf="form.get('detail').dirty && form.get('detail').errors">不能为空</nz-form-explain>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label nzXs="5" nzRequired nzFor="tryout">试听</nz-form-label>
            <nz-form-control nzXs="18">
                <input nz-input formControlName="tryout" id="tryout" placeholder="">
                <nz-form-explain *ngIf="form.get('tryout').dirty && form.get('tryout').errors">不能为空</nz-form-explain>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label nzXs="5" nzRequired nzFor="sequence">显示顺序</nz-form-label>
            <nz-form-control nzXs="18">
                <input nz-input formControlName="sequence" id="sequence" placeholder="">
                <nz-form-explain *ngIf="form.get('sequence').dirty && form.get('sequence').errors">不能为空</nz-form-explain>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label nzXs="5" nzRequired nzFor="playTime">播放次数</nz-form-label>
            <nz-form-control nzXs="18">
                <input nz-input formControlName="playTime" id="playTime" placeholder="">
                <nz-form-explain *ngIf="form.get('playTime').dirty && form.get('playTime').errors">不能为空</nz-form-explain>
            </nz-form-control>
        </nz-form-item>

    </form>

</ng-template>